from nonebot import on_message
from nonebot.adapters.onebot.v11 import GroupMessageEvent, Bot, Message
from nonebot.rule import regex
from datetime import datetime

on_greet = on_message(
    rule=regex(r'(?i)(小鸢|鸢酱|纸鸢)你好'),
    priority=1,
    block=False
)

@on_greet.handle()
async def qwq_detect(bot: Bot, event: GroupMessageEvent):
    now = datetime.now()
    hour = now.hour

    if 6 <= hour < 12:
        greeting = "早上好"
    elif 12 <= hour < 18:
        greeting = "下午好"
    else:
        greeting = "晚上好"

    res = f"喵喵喵~{greeting}喵~\n（纸鸢的自动骚扰信息）\n如需退订请回复续订喵~₍ᐢ⸝⸝›  ̫ ‹⸝⸝ᐢ₎ \n 如有问题请联系鸢酱~ \n喵喵喵~"
    await on_greet.send(
        message=Message(
            f"{res}"
        )
    )